package day3

trait sayHello {
  val msg:String
  def sayHello(name:String)=println(msg +" , "+name)
}
class Person(val name:String) extends sayHello{
  val msg:String = "hello"
  def makeFriends(p:Person): Unit ={
    sayHello(p.name)
    println("I'm"+name +" I want to make frieds with you")
  }
}
object Test{
  def main(args: Array[String]) {
    val p1=new Person("zhangwuji")
    val p2=new Person("zhangsanfeng")
    p1.makeFriends(p2)

  }
}

